package com.cj.pojo;

public enum ArticleStatus {
    DRAFT("draft"),
    PUBLISHED("published"),
    ARCHIVED("archived");

    private final String value;

    ArticleStatus(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }

    public static ArticleStatus fromValue(String value) {
        for (ArticleStatus status : ArticleStatus.values()) {
            if (status.value.equals(value)) {
                return status;
            }
        }
        throw new IllegalArgumentException("Invalid ArticleStatus value: " + value);
    }
}
